package nju.bean.meeting.data;

import java.util.ArrayList;
import java.util.Date;

import nju.bean.meeting.database.DatabaseManager;

public class Meeting {
	boolean isInProgress = false;
	private long startTime;
	private long endTime;
	private String raiser;
	private String meetingName;
	private String meetingId;
	private String umlRecordId;
	private ArrayList<User> userList;
	private ArrayList<String> fileList;
	private int maxUserNum;
	
	
	public Meeting(int maxUserNum){
		this.maxUserNum = maxUserNum;
	}
	
	public Meeting(String name,String mId,int maxUserNum,User user){
		meetingName = name;
		meetingId = mId;
		raiser = user.getUserName();
		this.maxUserNum = maxUserNum ;
		startTime = new Date().getTime();
		userList = new ArrayList<User>();
		userList.add(user);
		fileList = new ArrayList<String>();
	}
	public Meeting (String name,String mId,String raiser,String umlId,int maxUserNum,long starttime,long endtime){
		this.meetingName = name;
		this.meetingId = mId;
		this.raiser = raiser;
		this.umlRecordId = umlId;
		this.maxUserNum = maxUserNum;
		this.startTime = starttime;
		this.endTime = endtime;
	}
	public boolean addUser(User user){
		if(userList.size()<maxUserNum&&isInProgress)
			return userList.add(user);
		return false;
	}
	public ArrayList<User> getUserList(){
		return userList;
	}
	
	public boolean addFile(String file){
		return fileList.add(file);
	}
    public void setFileList(ArrayList<String> fileList){
    	this.fileList = fileList;
    }
	public ArrayList<String> geFileList(){
		return fileList;
	}
	
	public String getMeetingId() {
		return meetingId;
	}

	public String getRaiser() {
		return raiser;
	}

	public void setRaiser(String raiser) {
		this.raiser = raiser;
	}
	
	public String getName(){
		return meetingName;
	}
	public long getStartTime(){
		return startTime;
	}
	public long getEndTime(){
		return endTime;
	}
	public void setEndTime(){
		endTime = new Date().getTime();
	}

	public void setUmlRecordId(String umlRecordId) {
		this.umlRecordId = umlRecordId;
	}

	public String getUmlRecordId() {
		return umlRecordId;
	}
	
	public int getMaxUserNum() {
		return maxUserNum;
	}
}
